home *** CD-ROM | disk | FTP | other *** search
- unit fIncrement;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, Buttons;
-
- type
- Tf_Increment = class(TForm)
- e_fileBuild: TEdit;
- E_ProductBuild: TEdit;
- e_comment: TEdit;
- L_FileBuild: TLabel;
- L_ProductBuild: TLabel;
- Label1: TLabel;
- BitBtn1: TBitBtn;
- procedure e_fileBuildKeyPress(Sender: TObject; var Key: Char);
- private
- fFileBuild, fProductBuild : integer;
- fComment : string;
- public
- end;
-
- Procedure SetIncrement(var aFileBuild, aProductBuild : integer; var aComment : string);
-
- implementation
- {$R *.DFM}
- { Tf_Increment }
-
- var
- f_increment : tf_increment;
-
- Procedure SetIncrement(var aFileBuild,
- aProductBuild: integer; var aComment: string);
- begin
- f_increment := tf_increment.create(nil);
- try
- with f_increment do begin
- L_FileBuild.caption := 'File Build # '+IntToStr(aFileBuild)+' will increment to: ';
- Inc(aFileBuild);
- e_FileBuild.text := InttoStr(aFileBuild);
- L_ProductBuild.caption := 'Product Build # '+IntToStr(aProductBuild)+' will increment to: ';
- Inc(aProductBuild);
- e_ProductBuild.text := InttoStr(aProductBuild);
- e_comment.text := aComment;
- Showmodal;
- if trim(e_fileBuild.text) = ''
- then e_fileBuild.text := '0';
- aFileBuild := StrtoInt(e_fileBuild.text);
- if trim(e_ProductBuild.text) = ''
- then e_ProductBuild.text := '0';
- aProductBuild := StrtoInt(e_ProductBuild.text);
- aComment := e_comment.text;
- end;
- finally
- f_increment.free;
- end;
- end;
-
- procedure Tf_Increment.e_fileBuildKeyPress(Sender: TObject; var Key: Char);
- begin
- if not (key in ['0'..'9', #27, #8, #9, #13])
- then key := #0;
- end;
-
- end.
-